package com.ydgk.dao;

import com.ydgk.bean.View;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ViewMapper {

    @Insert("insert into view values(#{vid},#{vphoto},#{f_fid})")
    int insert(View view);

    @Delete("delete from view where f_fid = #{fid}")
    void deleteByFid(int fid);

    @Select("select * from view where f_fid = #{fid}")
    List<View> findByFid(int fid);

    @Delete("delete from view where vid = #{param1} and f_fid = #{param2}")
    int deleteByIdAndFid(int vid,int fid);

    @Select("select * from view where vid = #{vid}")
    View findById(int vid);
}
